package cn.lau.demo.auth;

import org.apache.shiro.authc.AuthenticationToken;

/**
 * @author War horse imwarhorse@aliyun.com
 * Date: 2020/12/24
 * Description: No Description
 */
public class JWTToken implements AuthenticationToken {

	/* 用户名。如果为带token访问(非登录)行为，则为null */
	private String username;
	/* 用户凭证。如果为登录，则为password,如果为带token请求的行为，则为token */
	private String credentials;

	public JWTToken(String token) {
		this.credentials = token;
	}
	public JWTToken(String username,String credentials) {
		this.username = username;
		this.credentials = credentials;
	}

	@Override
	public Object getPrincipal() {
		return this.username;
	}

	@Override
	public Object getCredentials() {
		return this.credentials;
	}

	public void setCredentials(String credentials) {
		this.credentials = credentials;
	}

	public void setUsername(String username) {
		this.username = username;
	}
}
